package com.leiyuee.principle;

/**
 * 单一职责原则:
 * 降低类的复杂度 一个模块/一个类/一个方法 只做一件事
 */
public class SingleResponsibility {
    public static void main(String[] args) {

        Vehicle vehicle = new Vehicle();
        vehicle.runAir("飞机");
        vehicle.run("汽车");
        vehicle.runWater("轮船");
    }
}

class  Vehicle{
    public void run(String vehicle){
        System.out.println(vehicle+"在公路上运行...");
    }
    public void runAir(String vehicle){
        System.out.println(vehicle+"在天上运行...");
    }

    public void runWater(String vehicle){
        System.out.println(vehicle+"在水中运行...");
    }


}